#include "stdafx.h"
#include "Info.h"
#include <vector>
#pragma once


class Server
{
private:
	int sTT;
	string serverName;
	double tocDoXuLy;
	double donGiaThue;
	bool isIdle;
	bool isSuperServer;

	static vector<Server*>  listServer;
	
	Server(int sTT, string serverName, double tocDoXuLy, double donGiaThue, bool isSuperServer)
	{
		this->sTT = sTT;
		this->serverName = serverName;
		this->tocDoXuLy = tocDoXuLy;
		this->donGiaThue = donGiaThue;
		this->isIdle = true;
		this->isSuperServer = isSuperServer;
	}

	static void createListServer()
	{
		listServer.push_back(new Server(1,"ALPHA",250,12,false));
		listServer.push_back(new Server(2,"BETA",350,15,false));
		listServer.push_back(new Server(3,"GAMMA",500,20,false));
		listServer.push_back(new Server(4,"DELTA",650 ,25,false));
		listServer.push_back(new Server(5,"LAMBDA",800,30,false));
	}
public:

	string getServerName() {
        return serverName;
    }

    void setServerName(string serverName) {
        this->serverName = serverName;
    }

	static Server* seekIdleServer();
	static Server* seekIdleSuperServer();
	static void insertServer(int sTT, string serverName, double tocDoXuLy, double donGiaThue, bool isSuperServer);
	double caculateProcessTime(double doPhucTap);
	double cauculatePrice(double processTime);
}